<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>http::chunk_header</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Beast">
<link rel="up" href="../ref.html" title="This Page Intentionally Left Blank 2/2">
<link rel="prev" href="boost__beast__http__chunk_crlf/end.html" title="http::chunk_crlf::end">
<link rel="next" href="boost__beast__http__chunk_header/value_type.html" title="http::chunk_header::value_type">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boost__beast__http__chunk_crlf/end.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__http__chunk_header/value_type.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="beast.ref.boost__beast__http__chunk_header"></a><a class="link" href="boost__beast__http__chunk_header.html" title="http::chunk_header">http::chunk_header</a>
</h4></div></div></div>
<p>
        A <span class="emphasis"><em>chunk</em></span> header.
      </p>
<h5>
<a name="beast.ref.boost__beast__http__chunk_header.h0"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__chunk_header.synopsis"></a></span><a class="link" href="boost__beast__http__chunk_header.html#beast.ref.boost__beast__http__chunk_header.synopsis">Synopsis</a>
      </h5>
<p>
        Defined in header <code class="literal">&lt;<a href="../../../../../../boost/beast/http/chunk_encode.hpp" target="_top">boost/beast/http/chunk_encode.hpp</a>&gt;</code>
      </p>
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">chunk_header</span>
</pre>
<h5>
<a name="beast.ref.boost__beast__http__chunk_header.h1"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__chunk_header.types"></a></span><a class="link" href="boost__beast__http__chunk_header.html#beast.ref.boost__beast__http__chunk_header.types">Types</a>
      </h5>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
                <p>
                  Name
                </p>
              </th>
<th>
                <p>
                  Description
                </p>
              </th>
</tr></thead>
<tbody>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__http__chunk_header/const_iterator.html" title="http::chunk_header::const_iterator">const_iterator</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Required for <span class="emphasis"><em>ConstBufferSequence</em></span>
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__http__chunk_header/value_type.html" title="http::chunk_header::value_type">value_type</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Required for <span class="emphasis"><em>ConstBufferSequence</em></span>
                </p>
              </td>
</tr>
</tbody>
</table></div>
<h5>
<a name="beast.ref.boost__beast__http__chunk_header.h2"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__chunk_header.member_functions"></a></span><a class="link" href="boost__beast__http__chunk_header.html#beast.ref.boost__beast__http__chunk_header.member_functions">Member
        Functions</a>
      </h5>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
                <p>
                  Name
                </p>
              </th>
<th>
                <p>
                  Description
                </p>
              </th>
</tr></thead>
<tbody>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__http__chunk_header/begin.html" title="http::chunk_header::begin">begin</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Required for <span class="emphasis"><em>ConstBufferSequence</em></span>
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__http__chunk_header/chunk_header.html" title="http::chunk_header::chunk_header">chunk_header</a> <span class="silver">[constructor]</span></strong></span>
                </p>
              </td>
<td>
                <p>
                  Constructor. <br> <span class="silver">—</span><br> Required
                  for <span class="emphasis"><em>ConstBufferSequence</em></span>
                </p>
              </td>
</tr>
<tr>
<td>
                <p>
                  <span class="bold"><strong><a class="link" href="boost__beast__http__chunk_header/end.html" title="http::chunk_header::end">end</a></strong></span>
                </p>
              </td>
<td>
                <p>
                  Required for <span class="emphasis"><em>ConstBufferSequence</em></span>
                </p>
              </td>
</tr>
</tbody>
</table></div>
<h5>
<a name="beast.ref.boost__beast__http__chunk_header.h3"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__chunk_header.description"></a></span><a class="link" href="boost__beast__http__chunk_header.html#beast.ref.boost__beast__http__chunk_header.description">Description</a>
      </h5>
<p>
        This implements a <span class="emphasis"><em>ConstBufferSequence</em></span> representing the
        header of a <span class="emphasis"><em>chunk</em></span>. The serialized format is as follows:
      </p>
<pre class="programlisting"><span class="identifier">chunk</span><span class="special">-</span><span class="identifier">header</span>    <span class="special">=</span> <span class="number">1</span><span class="special">*</span><span class="identifier">HEXDIG</span> <span class="identifier">chunk</span><span class="special">-</span><span class="identifier">ext</span> <span class="identifier">CRLF</span>
<span class="identifier">chunk</span><span class="special">-</span><span class="identifier">ext</span>       <span class="special">=</span> <span class="special">*(</span> <span class="string">";"</span> <span class="identifier">chunk</span><span class="special">-</span><span class="identifier">ext</span><span class="special">-</span><span class="identifier">name</span> <span class="special">[</span> <span class="string">"="</span> <span class="identifier">chunk</span><span class="special">-</span><span class="identifier">ext</span><span class="special">-</span><span class="identifier">val</span> <span class="special">]</span> <span class="special">)</span>
<span class="identifier">chunk</span><span class="special">-</span><span class="identifier">ext</span><span class="special">-</span><span class="identifier">name</span>  <span class="special">=</span> <span class="identifier">token</span>
<span class="identifier">chunk</span><span class="special">-</span><span class="identifier">ext</span><span class="special">-</span><span class="identifier">val</span>   <span class="special">=</span> <span class="identifier">token</span> <span class="special">/</span> <span class="identifier">quoted</span><span class="special">-</span><span class="identifier">string</span>
</pre>
<p>
        The chunk extension is optional. After the header and chunk body have been
        serialized, it is the callers responsibility to also serialize the final
        CRLF (<code class="computeroutput"><span class="string">"\r\n"</span></code>). This
        class allows the caller to emit piecewise chunk bodies, by first serializing
        the chunk header using this class and then serializing the chunk body in
        a series of one or more calls to a stream write operation.
      </p>
<p>
        To use this class, pass an instance of it to a stream algorithm as the buffer
        sequence:
      </p>
<pre class="programlisting"><span class="comment">// writes "400;x\r\n"</span>
<span class="identifier">net</span><span class="special">::</span><span class="identifier">write</span><span class="special">(</span><span class="identifier">stream</span><span class="special">,</span> <span class="identifier">chunk_header</span><span class="special">{</span><span class="number">1024</span><span class="special">,</span> <span class="string">"x"</span><span class="special">});</span>
</pre>
<h5>
<a name="beast.ref.boost__beast__http__chunk_header.h4"></a>
        <span class="phrase"><a name="beast.ref.boost__beast__http__chunk_header.see_also"></a></span><a class="link" href="boost__beast__http__chunk_header.html#beast.ref.boost__beast__http__chunk_header.see_also">See
        Also</a>
      </h5>
<p>
        <a href="https://tools.ietf.org/html/rfc7230#section-4.1" target="_top">https://tools.ietf.org/html/rfc7230#section-4.1</a>
      </p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Vinnie
      Falco<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="boost__beast__http__chunk_crlf/end.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__http__chunk_header/value_type.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
